* Table 5: Impact on improved stoves

use "${output}panel_r0_r1_r2.dta", clear // Load merged analysis panel

********************************************************************************

* Keep households surveyed in each round
keep if sample_household == 1

********************************************************************************

* Analyses

local model_1 "i.treatment##i.surveyround"
local model_2 "i.treatment##i.chirag_strata##i.surveyround"
local estimation_options ", absorb(hh_id) vce(cluster uniquegrp) nocons"

estimates clear
foreach var of varlist improved_stove_* lpg_stove_* {

	sum `var' if surveyround == 0 & treatment == 0 & chirag_strata == 0
	local `var'_m = `r(mean)'
	qui autofmt, input(``var'_m') dec(2) strict
	local `var'_m = `r(output1)'
	local `var'_m : di %9.2f ``var'_m'

	forval i = 1/2 {
		
		// Estimation
		reghdfe `var' `model_`i'' `estimation_options'
		estimates store `var'_`i'

		// Test of difference between two triple-diff. estimands
		capture noisily test 1.treatment#1.chirag_strata#1.surveyround = 1.treatment#1.chirag_strata#2.surveyround

	}
}

********************************************************************************

// Generate table

estout * ///
	using "${results}/table_improved_stoves.tex", replace style(tex) ///
	cells("b(fmt(a2) star)" se(par fmt(a2))) ///
	keep(1.surveyround 2.surveyround ///
		1.treatment#1.surveyround 1.treatment#2.surveyround ///
		1.chirag_strata#1.surveyround 1.chirag_strata#2.surveyround ///
		1.treatment#1.chirag_strata#1.surveyround 1.treatment#1.chirag_strata#2.surveyround) ///
	stats(N r2_a, fmt(%15.0gc a2) labels("\(N\)" "Adjusted \(R^2\)")) ///
  	starlevels(* 0.10 ** 0.05 *** 0.01) ///
    collabels(none) mlabel(none) ///
	varlabels(1.surveyround "\({POST}_1\)" ///
			2.surveyround "\({POST}_2\)" ///
			1.treatment#1.surveyround "\({TREATMENT}_j \times {POST}_1\)" ///
			1.treatment#2.surveyround "\({TREATMENT}_j \times {POST}_2\)" ///
			1.chirag_strata#1.surveyround "\({NGO}_j \times {POST}_1\)" ///
			1.chirag_strata#2.surveyround "\({NGO}_j \times {POST}_2\)" ///
			1.treatment#1.chirag_strata#1.surveyround "\({TREATMENT}_j \times {NGO}_j \times {POST}_1\)" ///
			1.treatment#1.chirag_strata#2.surveyround "\({TREATMENT}_j \times {NGO}_j \times {POST}_2\)" ///
				, elist(1.surveyround " \addlinespace" ///
						2.surveyround " \addlinespace" ///
						1.treatment#1.surveyround " \addlinespace" ///
						1.treatment#2.surveyround " \addlinespace" ///
						1.chirag_strata#1.surveyround " \addlinespace" ///
						1.chirag_strata#2.surveyround " \addlinespace" ///
						1.treatment#1.chirag_strata#1.surveyround " \addlinespace") ///
				) ///
	prehead(  ///
		"\begin{sidewaystable}[h]" ///
		"\centering" ///
		"\caption{Effect of promotion on improved- and LPG-stove adoption in matched NGO/non-NGO villages\label{app:improved_stoves_tab}}" ///
		"\begin{adjustbox}{max width=\textwidth}" ///
		"\begin{threeparttable}" ///
		"\begin{tabular}{lcccccccc}" ///
		"\toprule" ///
        "& (1) & (2) & (3) & (4) & (5) & (6) & (7) & (8) \\ \cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(lr){6-7} \cmidrule(lr){8-9}" ///
        "& \multicolumn{2}{c}{$\mathbbm{1} \left( \text{Owns improved stove} \right)$} &  \multicolumn{2}{c}{$\mathbbm{1} \left( \text{Uses improved stove} \right)$} & \multicolumn{2}{c}{$\mathbbm{1} \left( \text{Owns LPG stove} \right)$} & \multicolumn{2}{c}{$\mathbbm{1} \left( \text{Uses LPG stove} \right)$} \\  \midrule" /// 
		)  ///
	prefoot("\midrule" ///
		"Baseline non-NGO control mean & `improved_stove_own_m' & `improved_stove_own_m' & `improved_stove_use_m' & `improved_stove_use_m' & `lpg_stove_own_m' & `lpg_stove_own_m' & `lpg_stove_use_m' & `lpg_stove_use_m'  \\" ///
		"Household fixed-effects & Yes & Yes & Yes & Yes & Yes & Yes & Yes & Yes \\" ///
		)  ///
	postfoot("\bottomrule" ///
			"\end{tabular}" ///
			"\begin{tablenotes}" ///
			"{\setlength\labelsep{0pt}" ///
			"\footnotesize" ///
			"\item \textit{Notes}. The outcome variables are ownership (columns 1–2) and use (columns 3–4) of all improved stoves as measured during baseline, and midline and endline follow-up surveys (conducted approximately three and fifteen months after the start of the intervention, respectively). The outcome variable for ownership is an indicator that equals 1 if household \(i\) in hamlet \(j\) reports owning at least one improved stove in survey round \(t\); for use, it is an indicator that equals 1 if the household---conditional on ownership---reports having used such a device in the past week. The even-numbered columns present the results of estimating the triple-differences specification outlined in Equation \eqref{e:triple-diff}. The accompanying odd-numbered columns present results from estimating a double-differences specification without NGO-specific interactions for comparison. 'Improved stove' includes stoves fuelled by biogas, electricity, LPG, kerosene, and commercially available efficient biomass cookstoves; we also include the two ICS promoted as part of the promotion intervention in this definition. Standard errors (in parentheses) are clustered at the hamlet level. \sym{*} \(p<0.10\), \sym{**} \(p<0.05\), \sym{***} \(p<0.01\).}" ///
			"\end{tablenotes}" ///
			"\end{threeparttable}" ///
			"\end{adjustbox}" ///
			"\end{sidewaystable}" ///
			)
